Skip to content

feat(claudecode): surface aiTitle + idle recap in the chat markdown#239

Open
huangruizhe wants to merge 1 commit into
specstoryai:devfrom
huangruizhe:feat/render-aititle-header
Open

feat(claudecode): surface aiTitle + idle recap in the chat markdown#239
huangruizhe wants to merge 1 commit into
specstoryai:devfrom
huangruizhe:feat/render-aititle-header

Conversation

@huangruizhe

Copy link
Copy Markdown
Contributor

Opt-in/quality-of-life feature — surfaces two artifacts Claude Code already generates but SpecStory currently drops. Opening for discussion; may be more useful as a personal preference than a default.

aiTitle as header metadata

Claude generates a stable session title (ai-title record's aiTitle), but it has no uuid so the parser drops it, and filenames are fixed at time-zero from the first message (often uninformative). This reads the latest aiTitle from the .jsonl (cheap scan — the title line is tiny), exposes it as SessionData.Title, and renders a **Title:** line right after the session-id comment. Blank/omitted when absent; filenames unchanged (purely additive metadata).

/recap (idle away_summary) rendered

The idle "away summary" (type:system, subtype:away_summary) is shown to the user on screen and already survives parsing (it has a uuid), but is never rendered. This emits it as a _**Recap (ts)**_ block where it occurred. Other system records (e.g. compact_boundary) stay hidden.

Testing

Unit tests: latest-aiTitle-wins + blank-when-absent, title header present/absent, away_summary rendered (compact_boundary not), recap header format. gofmt/goimports clean, golangci-lint run ./... → 0 issues, go test ./... green.

🤖 Generated with Claude Code

Two already-generated artifacts SpecStory drops today, exposed as content:

- aiTitle — Claude's stable session title (the `ai-title` record). It has no uuid
  so the parser drops it; read the latest from the .jsonl (cheap scan) into
  SessionData.Title and render a `**Title:**` metadata line right after the
  session-id comment. Blank/omitted when absent. Filenames unchanged.
- /recap — the idle "away_summary" (type=system, subtype=away_summary) the user
  saw on screen. It survives parsing (has uuid) but was never rendered; emit it as
  a `_**Recap (ts)**_` block where it occurred. Other system records stay hidden.

Tests: latest-aiTitle-wins + blank-when-absent, title header present/absent,
away_summary rendered (compact_boundary not), recap header format.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant